package io.zhengsh.juc._0thread;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import java.util.concurrent.TimeUnit;

@Setter
@Getter
@AllArgsConstructor
@NoArgsConstructor
public class Task implements Runnable {

    private String name;

    @Override
    public void run() {
        try {
            TimeUnit.SECONDS.sleep(2);
        } catch (InterruptedException e) { e.printStackTrace();}
        System.out.println("Executing :" + name + ", Current time :" + System.currentTimeMillis());
    }
}
